 /*

  * To change this template, choose Tools | Templates

  * and open the template in the editor.

  */



 package x;



 /**

  *

  * @author Joey

  */



 import java.awt.*;

 import javax.swing.*;

import java.net.URL;

import javax.imageio.ImageIO;




 class SplashScreen extends JWindow {

   private int duration;



   public SplashScreen(int d) {

     duration = d;



     JPanel content = (JPanel) getContentPane();

     content.setBackground(Color.white);

     int width = 845;

     int height = 680;

     Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();

     int x = (screen.width - width) / 2;

     int y = (screen.height - height) / 2;

     setBounds(x, y, width, height);



     //class loader method
      URL url= Thread.currentThread().getContextClassLoader().getResource("screen.jpg");


     content.add(new JLabel(new ImageIcon(url)), BorderLayout.CENTER);

     Color oraRed = new Color(156, 20, 20, 255);

     content.setBorder(BorderFactory.createLineBorder(oraRed, 5));



     setVisible(true);

     try {

       Thread.sleep(duration);

     } catch (Exception e) {

     }

     setVisible(false);

   }



 }
